<!-- HTML header for doxygen 1.8.10-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<title>NATS C Client with JetStream and Streaming support: microRequest</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;" >
   <div id="projectname">NATS C Client with JetStream and Streaming support
   &#160;<span id="projectnumber">3.10.0-beta</span>
   </div>
   <div id="projectbrief">The nats.io C Client, Supported by Synadia Communications Inc.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__micro_request_functions.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">microRequest<div class="ingroups"><a class="el" href="group__micro_group.html">- Microservices</a> &raquo; <a class="el" href="group__micro_functions.html">Functions</a></div></div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga6a6fa30291301abf54e25a24fde7e293" id="r_ga6a6fa30291301abf54e25a24fde7e293"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga6a6fa30291301abf54e25a24fde7e293">microRequest_AddHeader</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req, const char *key, const char *value)</td></tr>
<tr class="memdesc:ga6a6fa30291301abf54e25a24fde7e293"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a header to the underlying NATS request message.  <br /></td></tr>
<tr class="separator:ga6a6fa30291301abf54e25a24fde7e293"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad50a68e2193da36d7b477a34f488840c" id="r_gad50a68e2193da36d7b477a34f488840c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#gad50a68e2193da36d7b477a34f488840c">microRequest_DeleteHeader</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req, const char *key)</td></tr>
<tr class="memdesc:gad50a68e2193da36d7b477a34f488840c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes a header from the underlying NATS request message.  <br /></td></tr>
<tr class="separator:gad50a68e2193da36d7b477a34f488840c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6cf9c55a05fe1234ef264c25ca8294b3" id="r_ga6cf9c55a05fe1234ef264c25ca8294b3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga6cf9c55a05fe1234ef264c25ca8294b3">microRequest_GetConnection</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req)</td></tr>
<tr class="memdesc:ga6cf9c55a05fe1234ef264c25ca8294b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the connection associated with the request.  <br /></td></tr>
<tr class="separator:ga6cf9c55a05fe1234ef264c25ca8294b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga695cf95ff0f596affecbd3954fd498cf" id="r_ga695cf95ff0f596affecbd3954fd498cf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga695cf95ff0f596affecbd3954fd498cf">microRequest_GetData</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req)</td></tr>
<tr class="memdesc:ga695cf95ff0f596affecbd3954fd498cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the data in the the request, as a byte array.  <br /></td></tr>
<tr class="separator:ga695cf95ff0f596affecbd3954fd498cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3fd1eef10afd445f517d73f32c9d4fd0" id="r_ga3fd1eef10afd445f517d73f32c9d4fd0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga3fd1eef10afd445f517d73f32c9d4fd0">microRequest_GetDataLength</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req)</td></tr>
<tr class="memdesc:ga3fd1eef10afd445f517d73f32c9d4fd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of data bytes in the the request.  <br /></td></tr>
<tr class="separator:ga3fd1eef10afd445f517d73f32c9d4fd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab999f2b9972c4339f6f78f491dfc6f3b" id="r_gab999f2b9972c4339f6f78f491dfc6f3b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#gab999f2b9972c4339f6f78f491dfc6f3b">microRequest_GetEndpointState</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req)</td></tr>
<tr class="memdesc:gab999f2b9972c4339f6f78f491dfc6f3b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pointer to the user-provided endpoint state, if the request is associated with an endpoint.  <br /></td></tr>
<tr class="separator:gab999f2b9972c4339f6f78f491dfc6f3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab78f9e653c13c8bbbbaa74d50dd34aa4" id="r_gab78f9e653c13c8bbbbaa74d50dd34aa4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#gab78f9e653c13c8bbbbaa74d50dd34aa4">microRequest_GetHeaderKeys</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req, const char ***keys, int *count)</td></tr>
<tr class="memdesc:gab78f9e653c13c8bbbbaa74d50dd34aa4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the list of all header keys in the NATS message underlying the request.  <br /></td></tr>
<tr class="separator:gab78f9e653c13c8bbbbaa74d50dd34aa4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad28fb0245a4c6d3218e4d233c141d3ce" id="r_gad28fb0245a4c6d3218e4d233c141d3ce"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#gad28fb0245a4c6d3218e4d233c141d3ce">microRequest_GetHeaderValue</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req, const char *key, const char **value)</td></tr>
<tr class="memdesc:gad28fb0245a4c6d3218e4d233c141d3ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the header entry associated with <code>key</code> from the NATS message underlying the request.  <br /></td></tr>
<tr class="separator:gad28fb0245a4c6d3218e4d233c141d3ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad73789e910856e6d3ece0ea95f1c8a54" id="r_gad73789e910856e6d3ece0ea95f1c8a54"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#gad73789e910856e6d3ece0ea95f1c8a54">microRequest_GetHeaderValues</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req, const char *key, const char ***values, int *count)</td></tr>
<tr class="memdesc:gad73789e910856e6d3ece0ea95f1c8a54"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get all header values associated with <code>key</code> from the NATS message underlying the request.  <br /></td></tr>
<tr class="separator:gad73789e910856e6d3ece0ea95f1c8a54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga764c2ebab8816c4706d6e49e5cbe8320" id="r_ga764c2ebab8816c4706d6e49e5cbe8320"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga764c2ebab8816c4706d6e49e5cbe8320">microRequest_GetMsg</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req)</td></tr>
<tr class="memdesc:ga764c2ebab8816c4706d6e49e5cbe8320"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the NATS message underlying the request.  <br /></td></tr>
<tr class="separator:ga764c2ebab8816c4706d6e49e5cbe8320"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae87e12447ebc9864d38268a15c370182" id="r_gae87e12447ebc9864d38268a15c370182"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#gae87e12447ebc9864d38268a15c370182">microRequest_GetReply</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req)</td></tr>
<tr class="memdesc:gae87e12447ebc9864d38268a15c370182"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the reply subject set in this message.  <br /></td></tr>
<tr class="separator:gae87e12447ebc9864d38268a15c370182"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga285974d2b6bc4b1369d9a9aa495e8119" id="r_ga285974d2b6bc4b1369d9a9aa495e8119"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga285974d2b6bc4b1369d9a9aa495e8119">microRequest_GetService</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req)</td></tr>
<tr class="memdesc:ga285974d2b6bc4b1369d9a9aa495e8119"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pointer to the microservice associated with the request.  <br /></td></tr>
<tr class="separator:ga285974d2b6bc4b1369d9a9aa495e8119"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8947795096eb225b16af422026627efa" id="r_ga8947795096eb225b16af422026627efa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga8947795096eb225b16af422026627efa">microRequest_GetServiceState</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req)</td></tr>
<tr class="memdesc:ga8947795096eb225b16af422026627efa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pointer to the user-provided service state.  <br /></td></tr>
<tr class="separator:ga8947795096eb225b16af422026627efa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6727593cc380ad418e1d45d232ffea5e" id="r_ga6727593cc380ad418e1d45d232ffea5e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga6727593cc380ad418e1d45d232ffea5e">microRequest_GetSubject</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req)</td></tr>
<tr class="memdesc:ga6727593cc380ad418e1d45d232ffea5e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the subject of the request message.  <br /></td></tr>
<tr class="separator:ga6727593cc380ad418e1d45d232ffea5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9c50e895154b151d3c9dadd3502b80f9" id="r_ga9c50e895154b151d3c9dadd3502b80f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga9c50e895154b151d3c9dadd3502b80f9">microRequest_Respond</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req, const char *data, size_t len)</td></tr>
<tr class="memdesc:ga9c50e895154b151d3c9dadd3502b80f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Respond to a request, on the same NATS connection.  <br /></td></tr>
<tr class="separator:ga9c50e895154b151d3c9dadd3502b80f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga402e8ccd0602a27d333d50088f6a92a3" id="r_ga402e8ccd0602a27d333d50088f6a92a3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#ga402e8ccd0602a27d333d50088f6a92a3">microRequest_RespondError</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req, <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *err)</td></tr>
<tr class="memdesc:ga402e8ccd0602a27d333d50088f6a92a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Respond to a request with a simple error.  <br /></td></tr>
<tr class="separator:ga402e8ccd0602a27d333d50088f6a92a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae62bab929e8835da250870cfde2f22b2" id="r_gae62bab929e8835da250870cfde2f22b2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#gae62bab929e8835da250870cfde2f22b2">microRequest_RespondCustom</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req, <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *err, const char *data, size_t len)</td></tr>
<tr class="memdesc:gae62bab929e8835da250870cfde2f22b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Respond to a message, with an OK or an error.  <br /></td></tr>
<tr class="separator:gae62bab929e8835da250870cfde2f22b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab94d97619daf42590d7e6c6bd758b9ab" id="r_gab94d97619daf42590d7e6c6bd758b9ab"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_request_functions.html#gab94d97619daf42590d7e6c6bd758b9ab">microRequest_SetHeader</a> (<a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *req, const char *key, const char *value)</td></tr>
<tr class="memdesc:gab94d97619daf42590d7e6c6bd758b9ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add <code>value</code> to the header associated with <code>key</code> in the NATS message underlying the request.  <br /></td></tr>
<tr class="separator:gab94d97619daf42590d7e6c6bd758b9ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Functions that operate with <a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4" title="a request received by a microservice endpoint.">microRequest</a>. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga6a6fa30291301abf54e25a24fde7e293" name="ga6a6fa30291301abf54e25a24fde7e293"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6a6fa30291301abf54e25a24fde7e293">&#9670;&#160;</a></span>microRequest_AddHeader()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microRequest_AddHeader </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
    <tr><td class="paramname">key</td><td>the key under which the <code>value</code> will be stored. It can't ne <code>NULL</code> or empty. </td></tr>
    <tr><td class="paramname">value</td><td>the string to add to the values associated with the given <code>key</code>. The value can be <code>NULL</code> or empty string.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#ga2b641ec3b1745604d7de1102e472254b" title="Add value to the header associated with key.">natsMsgHeader_Add</a>, <a class="el" href="group__micro_request_functions.html#gad50a68e2193da36d7b477a34f488840c" title="Deletes a header from the underlying NATS request message.">microRequest_DeleteHeader</a>, <a class="el" href="group__micro_request_functions.html#gab78f9e653c13c8bbbbaa74d50dd34aa4" title="Gets the list of all header keys in the NATS message underlying the request.">microRequest_GetHeaderKeys</a>, <a class="el" href="group__micro_request_functions.html#gad28fb0245a4c6d3218e4d233c141d3ce" title="Get the header entry associated with key from the NATS message underlying the request.">microRequest_GetHeaderValue</a>, <a class="el" href="group__micro_request_functions.html#gad73789e910856e6d3ece0ea95f1c8a54" title="Get all header values associated with key from the NATS message underlying the request.">microRequest_GetHeaderValues</a> </dd></dl>

</div>
</div>
<a id="gad50a68e2193da36d7b477a34f488840c" name="gad50a68e2193da36d7b477a34f488840c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad50a68e2193da36d7b477a34f488840c">&#9670;&#160;</a></span>microRequest_DeleteHeader()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microRequest_DeleteHeader </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
    <tr><td class="paramname">key</td><td>the key to delete from the headers map.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#gac78ca02dc93d05cae837ced6386408f1" title="Delete the value(s) associated with key.">natsMsgHeader_Delete</a>, <a class="el" href="group__micro_request_functions.html#ga6a6fa30291301abf54e25a24fde7e293" title="Adds a header to the underlying NATS request message.">microRequest_AddHeader</a> </dd></dl>

</div>
</div>
<a id="ga6cf9c55a05fe1234ef264c25ca8294b3" name="ga6cf9c55a05fe1234ef264c25ca8294b3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6cf9c55a05fe1234ef264c25ca8294b3">&#9670;&#160;</a></span>microRequest_GetConnection()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> * microRequest_GetConnection </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec" title="A connection to a NATS Server.">natsConnection</a> associated with the request. In fact, it's the connection associated with the service, so by the time the request handler is invoked the connection state may be different from when it was received. </dd></dl>

</div>
</div>
<a id="ga695cf95ff0f596affecbd3954fd498cf" name="ga695cf95ff0f596affecbd3954fd498cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga695cf95ff0f596affecbd3954fd498cf">&#9670;&#160;</a></span>microRequest_GetData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char * microRequest_GetData </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section note"><dt>Note</dt><dd>The request owns the data, so it should not be freed other than with <code>microRequest_Destroy</code>. </dd>
<dd>
The data is not <code>NULL</code> terminated. Use <code>microRequest_GetDataLength</code> to obtain the number of bytes.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to the request's data.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#ga523364451fd92534e754054266196e59" title="Returns the message payload.">natsMsg_GetData</a>, <a class="el" href="group__micro_request_functions.html#ga3fd1eef10afd445f517d73f32c9d4fd0" title="Returns the number of data bytes in the the request.">microRequest_GetDataLength</a> </dd></dl>

</div>
</div>
<a id="ga3fd1eef10afd445f517d73f32c9d4fd0" name="ga3fd1eef10afd445f517d73f32c9d4fd0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3fd1eef10afd445f517d73f32c9d4fd0">&#9670;&#160;</a></span>microRequest_GetDataLength()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> int microRequest_GetDataLength </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of data bytes in the request.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#ga25b69066ae50287e178aaf4f70f7d3de" title="Returns the message length.">natsMsg_GetDataLength</a>, <a class="el" href="group__micro_request_functions.html#ga695cf95ff0f596affecbd3954fd498cf" title="Returns the data in the the request, as a byte array.">microRequest_GetData</a> </dd></dl>

</div>
</div>
<a id="gab999f2b9972c4339f6f78f491dfc6f3b" name="gab999f2b9972c4339f6f78f491dfc6f3b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab999f2b9972c4339f6f78f491dfc6f3b">&#9670;&#160;</a></span>microRequest_GetEndpointState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void * microRequest_GetEndpointState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the <code>state</code> pointer provided in microEndpointConfig.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_types.html#ga7718d2f2c911e4cf677788f4ffe048cd" title="The Microservice endpoint configuration object.">microEndpointConfig</a>, <a class="el" href="structmicro__endpoint__config__s.html">micro_endpoint_config_s</a> </dd></dl>

</div>
</div>
<a id="gab78f9e653c13c8bbbbaa74d50dd34aa4" name="gab78f9e653c13c8bbbbaa74d50dd34aa4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab78f9e653c13c8bbbbaa74d50dd34aa4">&#9670;&#160;</a></span>microRequest_GetHeaderKeys()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microRequest_GetHeaderKeys </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char ***&#160;</td>
          <td class="paramname"><em>keys</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The returned strings are own by the library and MUST not be freed or altered. However, the returned array <code>keys</code> MUST be freed by the user.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
    <tr><td class="paramname">keys</td><td>the memory location where the library will store the pointer to the array of keys. </td></tr>
    <tr><td class="paramname">count</td><td>the memory location where the library will store the number of keys returned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#ga6ee8a007111ada293dd24ff0bab02491" title="Get all header keys.">natsMsgHeader_Keys</a>, <a class="el" href="group__micro_request_functions.html#gad28fb0245a4c6d3218e4d233c141d3ce" title="Get the header entry associated with key from the NATS message underlying the request.">microRequest_GetHeaderValue</a>, <a class="el" href="group__micro_request_functions.html#gad73789e910856e6d3ece0ea95f1c8a54" title="Get all header values associated with key from the NATS message underlying the request.">microRequest_GetHeaderValues</a> </dd></dl>

</div>
</div>
<a id="gad28fb0245a4c6d3218e4d233c141d3ce" name="gad28fb0245a4c6d3218e4d233c141d3ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad28fb0245a4c6d3218e4d233c141d3ce">&#9670;&#160;</a></span>microRequest_GetHeaderValue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microRequest_GetHeaderValue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
    <tr><td class="paramname">key</td><td>the key for which the value is requested. </td></tr>
    <tr><td class="paramname">value</td><td>the memory location where the library will store the pointer to the first value (if more than one is found) associated with the <code>key</code>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#gab3349f0b0ce721b340d5c0753c90ee18" title="Get the header entry associated with key.">natsMsgHeader_Get</a>, <a class="el" href="group__micro_request_functions.html#gad28fb0245a4c6d3218e4d233c141d3ce" title="Get the header entry associated with key from the NATS message underlying the request.">microRequest_GetHeaderValue</a>, <a class="el" href="group__micro_request_functions.html#gad73789e910856e6d3ece0ea95f1c8a54" title="Get all header values associated with key from the NATS message underlying the request.">microRequest_GetHeaderValues</a> </dd></dl>

</div>
</div>
<a id="gad73789e910856e6d3ece0ea95f1c8a54" name="gad73789e910856e6d3ece0ea95f1c8a54"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad73789e910856e6d3ece0ea95f1c8a54">&#9670;&#160;</a></span>microRequest_GetHeaderValues()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microRequest_GetHeaderValues </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char ***&#160;</td>
          <td class="paramname"><em>values</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
    <tr><td class="paramname">key</td><td>the key for which the values are requested. </td></tr>
    <tr><td class="paramname">values</td><td>the memory location where the library will store the pointer to the array value (if more than one is found) associated with the <code>key</code>. </td></tr>
    <tr><td class="paramname">count</td><td>the memory location where the library will store the number of values returned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#gae1ce9c9d82d151a3ea9dc03da048f66f" title="Get all header values associated with key.">natsMsgHeader_Values</a>, <a class="el" href="group__micro_request_functions.html#gad28fb0245a4c6d3218e4d233c141d3ce" title="Get the header entry associated with key from the NATS message underlying the request.">microRequest_GetHeaderValue</a>, <a class="el" href="group__micro_request_functions.html#gab78f9e653c13c8bbbbaa74d50dd34aa4" title="Gets the list of all header keys in the NATS message underlying the request.">microRequest_GetHeaderKeys</a> </dd></dl>

</div>
</div>
<a id="ga764c2ebab8816c4706d6e49e5cbe8320" name="ga764c2ebab8816c4706d6e49e5cbe8320"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga764c2ebab8816c4706d6e49e5cbe8320">&#9670;&#160;</a></span>microRequest_GetMsg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a">natsMsg</a> * microRequest_GetMsg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the pointer to <a class="el" href="group__types_group.html#gadcab54026c4ed78f344ce03ce31bb61a" title="A structure holding a subject, optional reply and payload.">natsMsg</a>. </dd></dl>

</div>
</div>
<a id="gae87e12447ebc9864d38268a15c370182" name="gae87e12447ebc9864d38268a15c370182"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae87e12447ebc9864d38268a15c370182">&#9670;&#160;</a></span>microRequest_GetReply()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char * microRequest_GetReply </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the reply, possibly <code>NULL</code>.</p>
<dl class="section warning"><dt>Warning</dt><dd>The string belongs to the message and must not be freed. Copy it if needed.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga285974d2b6bc4b1369d9a9aa495e8119" name="ga285974d2b6bc4b1369d9a9aa495e8119"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga285974d2b6bc4b1369d9a9aa495e8119">&#9670;&#160;</a></span>microRequest_GetService()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> * microRequest_GetService </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the microservice pointer. </dd></dl>

</div>
</div>
<a id="ga8947795096eb225b16af422026627efa" name="ga8947795096eb225b16af422026627efa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8947795096eb225b16af422026627efa">&#9670;&#160;</a></span>microRequest_GetServiceState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void * microRequest_GetServiceState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the <code>state</code> pointer provided in microServiceConfig.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_types.html#ga1e46c0657cf42e83b366d224f380fb55" title="The microservice configuration object.">microServiceConfig</a>, <a class="el" href="structmicro__service__config__s.html" title="The Microservice top-level configuration object.">micro_service_config_s</a> </dd></dl>

</div>
</div>
<a id="ga6727593cc380ad418e1d45d232ffea5e" name="ga6727593cc380ad418e1d45d232ffea5e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6727593cc380ad418e1d45d232ffea5e">&#9670;&#160;</a></span>microRequest_GetSubject()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> const char * microRequest_GetSubject </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section warning"><dt>Warning</dt><dd>The string belongs to the message and must not be freed. Copy it if needed.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga9c50e895154b151d3c9dadd3502b80f9" name="ga9c50e895154b151d3c9dadd3502b80f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9c50e895154b151d3c9dadd3502b80f9">&#9670;&#160;</a></span>microRequest_Respond()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microRequest_Respond </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
    <tr><td class="paramname">data</td><td>the response data. </td></tr>
    <tr><td class="paramname">len</td><td>the length of the response data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an error, if any. </dd></dl>

</div>
</div>
<a id="ga402e8ccd0602a27d333d50088f6a92a3" name="ga402e8ccd0602a27d333d50088f6a92a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga402e8ccd0602a27d333d50088f6a92a3">&#9670;&#160;</a></span>microRequest_RespondError()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microRequest_RespondError </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td>
          <td class="paramname"><em>err</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>If err is NULL, <code>RespondError</code> does nothing.</p>
<dl class="section note"><dt>Note</dt><dd>microRequest_RespondError is called automatially if the handler returns an error. Usually, there is no need for a handler to use this function directly. If the request</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
    <tr><td class="paramname">err</td><td>the error to include in the response header. If <code>NULL</code>, no error.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an error, if any. </dd></dl>

</div>
</div>
<a id="gae62bab929e8835da250870cfde2f22b2" name="gae62bab929e8835da250870cfde2f22b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae62bab929e8835da250870cfde2f22b2">&#9670;&#160;</a></span>microRequest_RespondCustom()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microRequest_RespondCustom </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td>
          <td class="paramname"><em>err</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>If err is NULL, <code>RespondErrorWithData</code> is equivalent to <code>Respond</code>. If err is not NULL, the response will include the error in the response header, and err will be freed.</p>
<p>The following example illustrates idiomatic usage in a request handler. Since this handler handles its own error responses, the only error it might return would be a failure to send the response.</p>
<div class="fragment"><div class="line">err = somefunc();</div>
<div class="line"><span class="keywordflow">if</span> (err != NULL) {</div>
<div class="line">    <span class="keywordflow">return</span> <a class="code hl_function" href="group__micro_request_functions.html#gae62bab929e8835da250870cfde2f22b2">microRequest_RespondCustom</a>(req, err, error_data, data_len);</div>
<div class="line">}</div>
<div class="line">...</div>
<div class="ttc" id="agroup__micro_request_functions_html_gae62bab929e8835da250870cfde2f22b2"><div class="ttname"><a href="group__micro_request_functions.html#gae62bab929e8835da250870cfde2f22b2">microRequest_RespondCustom</a></div><div class="ttdeci">NATS_EXTERN microError * microRequest_RespondCustom(microRequest *req, microError *err, const char *data, size_t len)</div><div class="ttdoc">Respond to a message, with an OK or an error.</div></div>
</div><!-- fragment --><p>Or, if the request handler has its own cleanup logic:</p>
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (err = somefunc(), err != NULL)</div>
<div class="line">    <span class="keywordflow">goto</span> CLEANUP;</div>
<div class="line">...</div>
<div class="line"> </div>
<div class="line">CLEANUP:</div>
<div class="line"><span class="keywordflow">if</span> (err != NULL) {</div>
<div class="line">    <span class="keywordflow">return</span> <a class="code hl_function" href="group__micro_request_functions.html#gae62bab929e8835da250870cfde2f22b2">microRequest_RespondCustom</a>(req, err, error_data, data_len);</div>
<div class="line">}</div>
<div class="line"><span class="keywordflow">return</span> NULL;</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
    <tr><td class="paramname">err</td><td>the error to include in the response header. If <code>NULL</code>, no error. </td></tr>
    <tr><td class="paramname">data</td><td>the response data. </td></tr>
    <tr><td class="paramname">len</td><td>the length of the response data.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<dl class="section return"><dt>Returns</dt><dd>an error, if any. </dd></dl>

</div>
</div>
<a id="gab94d97619daf42590d7e6c6bd758b9ab" name="gab94d97619daf42590d7e6c6bd758b9ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab94d97619daf42590d7e6c6bd758b9ab">&#9670;&#160;</a></span>microRequest_SetHeader()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microRequest_SetHeader </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga417ace5dc09fe8a2f6fd3882302a37c4">microRequest</a> *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>the request. </td></tr>
    <tr><td class="paramname">key</td><td>the key under which the <code>value</code> will be stored. It can't ne <code>NULL</code> or empty. </td></tr>
    <tr><td class="paramname">value</td><td>the string to store under the given <code>key</code>. The value can be <code>NULL</code> or empty string.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__msg_group.html#gaf30b47d4217c9335919f05536e379af8" title="Set the header entries associated with key to the single element value.">natsMsgHeader_Set</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">NATS.IO Supported By Synadia Communications Inc.
    <a href="http://www.nats.io">
    </a></li>
  </ul>
</div>
</body>
</html>
